package 刷题10月.脑筋急转弯类型;
// https://leetcode-cn.com/problems/maximum-lcci/
public class 面试题1607最大数值移位1005 {
    class Solution {
        public int maximum(int a, int b) {
            // a > b 时 k 为 1
            long sign = (long)b  - (long)a;
            int k = (int)(sign >> 63 & 1) ;
            //计算公式 a > b retrun a * 1 + b * 0
            //计算公式 a < b retrun a * 0 + b * 1
            //所以得获取 k 的值
            return a*k + b*(k ^ 1);
        }
    }

}
